#pragma once

#include <map>

#include "Behaviour.h"
#include "Rect.h"

namespace game_engine { namespace library
{

// Forward declarations
class WIRidle;
class WIRwalking;

/*!
 * \class WanderInRegion
 * \brief 
 */
class WanderInRegion : public game_engine::components::Behaviour
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
private:
    utils::Rect region;
    string idleAnimationId;
    map<Direction,string> walkAnimationId;
    FLOAT32 maxWaitingTime;
    FLOAT32 walkSpeed;
    BOOL _isWalking;
    //library::WIRidle *idleState;
    //library::WIRwalking *walkingState;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    WanderInRegion(void);
    WanderInRegion(GameObject *obj, const utils::Rect &reg);
    virtual ~WanderInRegion(void);

    // Others
    void initialize(void) throw(...);
    void forceDestinationReached(void) throw(...);

    // Getters
    const utils::Rect& getRegion(void) const;
    const string& getIdleAnimationId(void) const;
    const string getWalkAnimationId(const Direction direction) const;
    const FLOAT32 getWalkSpeed(void) const;
    const FLOAT32 getMaxWaitingTime(void) const;
    const BOOL isWalking(void) const;

    // Setters
    void setRegion(const utils::Rect &reg);
    void setIdleAnimationId(const string &animId);
    void setWalkAnimationId(const Direction direction, const string &animId);
    void setWalkSpeed(const FLOAT32 speed);
    void setMaxWaitingTime(const FLOAT32 time);
    void setIsWalking(const BOOL isWalking);


};

}}
